package com.sinog.front.feign.biz;

import com.sinog.core.utilbean.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;

/**
 * @desc redis缓存字典表数据-feign
 * @author -
 * @date -
 */
@FeignClient("sinog2c-biz")
public interface DataToRedisService {

    /**
     * 全国行政区划编码名称 redis->map结构
     * k: areaCode
     * v: k->code_id v-code_name
     * @return Result
     */
    @PostMapping("/redis/api/azbj/saveAreaCodeData")
    Result saveAreaCodeData();

    /**
     * 罪名编码critypeCode、职业技能jineng
     * 罪名编码：critypeCode 2_12
     * 职业技能：jineng  4_1
     * @param keyName keyName
     * @param codeType codeType
     * @return Result
     */
    @PostMapping("/redis/api/azbj/saveAreaCodeData/critype")
    Result saveDataToRedisCritype(@RequestParam String keyName,@RequestParam String codeType);

    /**
     * 罪名编码中文critypeZn
     * 罪名编码：critypeZn 2_12
     * @param keyName redis存储键
     * @param codeType 字典表tbsys_code的code_type
     * @return Result
     */
    @PostMapping("/redis/api/azbj/saveAreaCodeData/critypeZn")
    Result saveDataToRedisCritypeZn(@RequestParam String keyName,@RequestParam String codeType);

    /**
     * 罪名分类编码fzlx
     * select code_id codeId,code_name codeName from tbsys_code where code_type=#{type} and pcode_id='-1'
     * @param keyName keyName
     * @param codeType codeType
     * @return Result
     */
    @PostMapping("/redis/api/azbj/saveAreaCodeData/critypeP")
    Result saveDataToRedisCritypeP(@RequestParam String keyName,@RequestParam String codeType);

    /**
     * 全国行政区划编码及父编码-redis-map结构
     * k: areaCodeAndPcode
     * v: codeId-pCode
     * @return Result
     */
    @PostMapping("/redis/api/azbj/saveAreaCodeData/codeParent")
    Result saveDataToRedisCodeParent();

    /**
     * 缓存捕前职业bqzy 2_8 key中文value code
     * @param keyName keyName
     * @return Result
     */
    @PostMapping("/redis/api/azbj/saveAreaCodeData/bqzyZn")
    Result saveDataToRedisBqzyZn(@RequestParam String keyName);

    /**
     * 缓存捕前职业bqzy 2_8 key code value中文
     * @param keyName keyName
     * @return Result
     */
    @PostMapping("/redis/api/azbj/saveAreaCodeData/bqzy")
    Result saveDataToRedisBqzy(@RequestParam String keyName);

    /**
     * 缓存罪名对应的顶级犯罪类型
     * @param keyName keyName
     * @return Result
     */
    @PostMapping("/redis/api/azbj/saveAreaCodeData/critypeAndFzlx")
    Result saveDataToRedisCritypeAndFzlx(@RequestParam String keyName);

    /**
     * 根据code集合查询省市区县拼接字符串
     * @param codes codes
     * @return List<String>
     */
    @PostMapping("/redis/api/azbj/selectAreaStr")
    List<String> selectAreaStr(@RequestBody String codes);

    /**
     * 获取全部行政区划
     * @param pushTbsysCode pushTbsysCode
     * @return Result
     */
    @PostMapping("/redis/api/azbj/saveDataToRedisXzqh")
    Result saveDataToRedisXzqh(String pushTbsysCode);

    /**
     * 全身的编码加名称
     * @param keyName keyName
     * @return Result
     */
    @PostMapping("/redis/api/azbj/saveAreaCodeData/province")
    Result saveDataToRedisProvince(@RequestParam String keyName);
}